const db = require('../config/db')
const {DataTypes} = require('sequelize');


const attributes = {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,    // 主键
        autoIncrement: true,// 自动递增
        comment: 'id',
    },
    location: {
        type: DataTypes.STRING,
        comment: '用户地址',
        allowNull: false
    },
    ip_location: {
        type: DataTypes.STRING,
        comment: '用户的ip地址',
        allowNull: false
    },

    create_date: {
        type: DataTypes.DATE,
        comment: '日期',
    }
}

const PageViewStatisticsModel = db.define('Page_view_statistics', attributes)

// PageViewStatisticsModel.sync({alter: true})

module.exports = PageViewStatisticsModel

